import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.security.crypto.bcrypt.BCrypt;

/**
 * @author : xiaohong
 * @date : 2021/5/7 20:09
 */
//@SpringBootTest
public class testDemo {

    // 加密
    @Test
    public void getEncode(){
        System.out.println(BCrypt.hashpw("PC", BCrypt.gensalt()));
    }

    // 解密
    @Test
    public void getDecode(){
        System.out.println(BCrypt.checkpw("Android","$2a$10$AbMi5v.MwMOzpt2dVWlri.JA2CMMvM9HJmV/mLZhOIBIa7pEZQYma"));
    }

}
